package com.aaa.common.util;


/**
 * @FileName: BaseUtil
 * @Description:项目通用工具类
 * @Author: zhz
 * @CreateTime: 2025/7/10 14:40
 * @Version: 1.0.0
 */
//@Component
public class BaseUtil {
    /**
     * @description: 统一返回成功
     * @param: [data]
     * @return: com.aaa.ssm.util.Result
     * @author: zhz
     * @date: 2025/7/2 9:15
     */
    //<T> 声明泛型
    public static  <A> Result success(A data) {
        return new Result(ResultStatus.SUCCESS.getReturnCode(),  ResultStatus.SUCCESS.getReturnMessage(), data);
    }

    /**
     * @description: 统一返回失败
     * @param: [data]
     * @return: com.aaa.ssm.util.Result
     * @author: zhz
     * @date: 2025/7/2 9:15
     */
    //<T> 声明泛型
    public  static  <A> Result fail(A data) {
        return new Result(ResultStatus.FAIL.getReturnCode(),  ResultStatus.FAIL.getReturnMessage(), data);
    }
}
